<template>
    <div>
        <div>姓名：{{userInfo.name}}</div>
        <div>姓别：{{userInfo.sex}}</div>
        <div>地址：{{userInfo.address}}</div>
        <div>关系：{{userInfo.relation}}</div>
        <div>生日：{{userInfo.birthday}}</div>
        <div>身份号：{{userInfo.idCard && userInfo.idCard.replace(userInfo.idCard.substr(-4), '****')}}</div>

    </div>
</template>

<script>
import { apigetDetail } from '@/api'
export default {
    data() {
        return {
            userInfo: {}
        }
    },
    created() {
        console.log(this.$route)
        this.getDetail()
    },
    methods: {
        getDetail() {
            apigetDetail({id: this.$route.params.id}).then(res => {
                this.userInfo = res.data
            })
        }
    },
}
</script>